[HVM] Add triple-fault handler (resets the domain).
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 3 Jan 2007 10:01:32 +0000 (10:01 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 3 Jan 2007 10:01:32 +0000 (10:01 +0000)
Todo: How to hook this for SVM?
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/vmx/vmx.c
xen/include/asm-x86/hvm/support.h

index ec045ad38953a4c9d466bdf2f083ae79180f724c..119b3bd625a83a9d4a99021632b148d8cfc77394 100644 (file)
@@ -269,6 +269,12 @@ void hvm_hlt(unsigned long rflags)
     do_sched_op_compat(SCHEDOP_block, 0);
 }
 
+void hvm_triple_fault(void)
+{
+    gdprintk(XENLOG_INFO, "Triple fault - reset.\n");
+    domain_shutdown(current->domain, SHUTDOWN_reboot);
+}
+
 /*
  * __hvm_copy():
  *  @buf  = hypervisor buffer
index 36abbd290bd1451c92082e1607710ae5b19d1990..473b2eee0622c020121594c3ba2195e849770e43 100644 (file)
@@ -2404,7 +2404,8 @@ asmlinkage void vmx_vmexit_handler(struct cpu_user_regs *regs)
         vmx_do_extint(regs);
         break;
     case EXIT_REASON_TRIPLE_FAULT:
-        goto exit_and_crash;
+        hvm_triple_fault();
+        break;
     case EXIT_REASON_PENDING_INTERRUPT:
         /* Disable the interrupt window. */
         v->arch.hvm_vcpu.u.vmx.exec_control &= ~CPU_BASED_VIRTUAL_INTR_PENDING;
index 3f3ff94386c9c4f03184c27523cde851418f5db2..721492412aec1923966cac33d94ca251802d10be 100644 (file)
@@ -134,5 +134,6 @@ void hlt_timer_fn(void *data);
 void hvm_do_hypercall(struct cpu_user_regs *pregs);
 
 void hvm_hlt(unsigned long rflags);
+void hvm_triple_fault(void);
 
 #endif /* __ASM_X86_HVM_SUPPORT_H__ */